import org.junit.Assert;
import org.junit.Test;

import static org.junit.Assert.*;

public class NGuessNumberTest {

    @Test
    public void fill() {
        String str = new NGuessNumber().generateAnswer();
        System.out.println(str);
        int o = Integer.parseInt(str.substring(0, 1));
        int t = Integer.parseInt(str.substring(1, 2));
        int thr = Integer.parseInt(str.substring(2, 3));
        int four = Integer.parseInt(str.substring(3, 4));
        Assert.assertEquals(4, str.length());
    
        Assert.assertNotEquals(o, two);
        Assert.assertNotEquals(o, thr);
        Assert.assertNotEquals(o, four);
        Assert.assertNotEquals(t, thr);
        Assert.assertNotEquals(t, four);
        Assert.assertNotEquals(thr, four);
   

        Assert.assertTrue(o >= 0 && o <= 9);
        Assert.assertTrue(t >= 0 && t <= 9);
        Assert.assertTrue(thr >= 0 && thr <= 9);
        Assert.assertTrue(four >= 0 && four <= 9);

    }

    @Test
    public void in_it() {
        NGuessNumber nGuessNumber = new NGuessNumber();
        Assert.assertEquals("2A2B", nGuessNumber.compareGuessAnswer(1432 + "", 1234 + ""));
    }

    @Test
    public void actionPerformed() {
        NGuessNumber nGuessNumber = new NGuessNumber();
        nGuessNumber.compareGuessAnswer(1234 + "", 1234 + "");
        Assert.assertTrue(nGuessNumber.isWin());
    }

    @Test
    public void main() {
         new NGuessNumberTest();
    }
}